import React, {Component} from 'react';
import { Icon, Dropdown, Menu } from 'antd';
import { cdn } from '../config/httpConfig';
const menu = (
    <Menu>
        <Menu.Item key="edit_pwd">修改密码</Menu.Item>
        <Menu.Item key="logout">
            <a href='/logout'>退出登录</a>
        </Menu.Item>
    </Menu>
);
export default class Header extends Component {
    render () {
        const { loginData: { data: { avatar, real_name } } } = this.props;
        return <div className='app-header'>
            <div className='app-header_side'>
                {/* <Icon type="bars" className='app-header_bars'/> */}
                <img src='http://inimg.sfc365.com/congo/img/newlogo.svg' className='app-header_logo' />
            </div>
            <div className='app-header_content'>
                <Dropdown overlay={menu}>
                    <a className="ant-dropdown-link" href="javascript:;">
                        <img src={cdn + avatar} className='app-header_avatar' />
                        {real_name} <Icon type="down" />
                    </a>
                </Dropdown>
            </div>
        </div>;
    }
}
